package com.xxbb.springbootapi.service.impl;

import com.xxbb.springbootapi.entity.Role;
import com.xxbb.springbootapi.entity.User;
import com.xxbb.springbootapi.mapper.UserMapper;
import com.xxbb.springbootapi.service.IUserService;
import com.xxbb.springbootapi.wrapper.UserQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService extends BaseService<UserMapper,User> implements IUserService{
    /**
     * 获取mapper
     *
     * @return
     */
    public UserMapper getMapper() {
        return super.dao.mapper;
    }

    /**
     * 获取query
     *
     * @return
     */
    public UserQuery getQuery() {
        return super.dao.mapper.query();
    }
    @Override
    public User getSiteOperator(){
        Integer userId=new  SiteOperatorService().getOperator().getUserId();
        return getMapper().findById(userId);
    }
}
